﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace BanquetGift.Models
{
    /// <summary>
    /// 系统数据字典
    /// </summary>
    [Table("dataDictionary")]
    public class DataDictionary: BaseModel<int>
    {
        /// <summary>
        /// 父级 Id
        /// </summary>
        [Display(Name = "父级 Id")]
        [Required(ErrorMessage = "请输入父级 Id")]
        public int ParentId { get; set; } = 0;
        /// <summary>
        /// 数据字典名称
        /// </summary>
        [Display(Name = "数据字典名称")]
        [Required(ErrorMessage = "数据字典名称是必须的")]
        [MaxLength(50,ErrorMessage ="名称最大长度为 50 个字")]
        public string DtDicName { get; set; }
        /// <summary>
        /// 数据字典的描述
        /// </summary>
        [Display(Name = "数据字典的描述")]
        [MaxLength(200,ErrorMessage ="描述最大长度 200 个字")]
        public string Description { get; set; }
        /// <summary>
        /// 数据字典的排序
        /// </summary>
        [Display(Name = "数据字典的排序")]
        [Required]
        public int SortIndex { get; set; } = 0;
    }
}
